Goblin Editor
Requirements
Effects
Modifiers
Build/Action Cost
Trigger Cond.
Fire Event
Assignment
Area Adjacency
Tech
Bldg
Pop
Res
Actions
Stats
Trig
Events
Areas
Edit Node
Tap a node on the canvas to edit it.
Global Tags & Filter
Add Global Tag
In expressions: tag = distinct active types, tag_count = total instances.
Filter canvas by tag

Expression Reference

This is JavaScript

Expressions run as real JS code. Write simple math or full multi-line logic.

Simple expressions

Multi-line / block expressions

Use return to return a value from multi-line code:

let base = 800;
let reduction = 0.9 ** stat_carpentry;
return max(1, base * reduction);
if (tech_Iron_Working) return 50;
return 120;

Stats

Stats use the stat_ prefix: stat_carpentry, stat_alchemy

Node count variables

Spaces in names become underscores: Iron Workingtech_Iron_Working

Tag variables

Built-in helpers

Examples by use case

Build / research time that scales down with a stat:

max(1, 800 * 0.9^stat_carpentry)

Starts at 800 ticks, shrinks by 10% per carpentry level, never below 1.

Cost that scales with multiple factors:

max(1, 800 * 0.9^stat_carpentry * 0.85^build_Sawmill)

Stacks two separate diminishing curves — both carpentry stat and Sawmill count reduce cost.

Flat bonus per pop:

pop_Worker * 3

Each Worker adds 3 to the result (e.g. a resource modifier).

Unlock gate — different value based on tech:

tech_Iron_Working ? 50 : 120

Returns 50 if Iron Working is researched, 120 otherwise. Good for build times.

Random loot drop (effect delta):

round(rand * 10) + 5

Gives 5–15 of a resource, randomly each time the action fires.

Clamp a scaling value:

clamp(stat_carpentry * 5, 10, 100)

Scales with carpentry but is always between 10 and 100.

Multi-line: tiered output based on stat level:

if (stat_carpentry >= 10) return 200;
if (stat_carpentry >= 5) return 100;
return 40;

Returns different values depending on thresholds. No need for nested ternaries.

Multi-line: complex cost reduction:

let base = 500;
let discount = build_Lumberyard * 0.05;
let reduced = base * (1 - discount);
return max(10, round(reduced));

Each Lumberyard gives a 5% discount, rounded, floored at 10.

Tag-based: reward scales with military presence:

military_count * 2 + 10

Uses the total count of all military-tagged node instances.